package sgi.client;

import javax.swing.JFrame;

import java.sql.ResultSet;
import java.util.Calendar;
import java.util.Date;
import java.sql.SQLException;

import javax.sql.rowset.*;

import com.sun.rowset.CachedRowSetImpl;
import java.awt.GridBagLayout;
import javax.swing.JLabel;
import java.awt.GridBagConstraints;
import java.awt.Insets;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

@SuppressWarnings("serial")
public class DailyReportPanel extends JFrame {
	
	private static CachedRowSetImpl reportInfo;
	
	public DailyReportPanel(CachedRowSetImpl reportInfo) throws SQLException {
		//setVisible(true);
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		reportInfo.next();
		
		setTitle("SGI Daily Report");
		GridBagLayout gridBagLayout = new GridBagLayout();
		gridBagLayout.columnWidths = new int[]{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
		gridBagLayout.rowHeights = new int[]{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
		gridBagLayout.columnWeights = new double[]{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE};
		gridBagLayout.rowWeights = new double[]{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE};
		getContentPane().setLayout(gridBagLayout);
		setBounds(100, 100, 465, 409);
		
		
		JLabel lblDate = new JLabel("Date: ");
		GridBagConstraints gbc_lblDate = new GridBagConstraints();
		gbc_lblDate.insets = new Insets(0, 0, 5, 5);
		gbc_lblDate.gridx = 1;
		gbc_lblDate.gridy = 1;
		getContentPane().add(lblDate, gbc_lblDate);
		
		JLabel lblAdate = new JLabel("aDate");
		if (reportInfo != null)
			lblAdate.setText(reportInfo.getString(1));
		GridBagConstraints gbc_lblAdate = new GridBagConstraints();
		gbc_lblAdate.insets = new Insets(0, 0, 5, 5);
		gbc_lblAdate.gridx = 2;
		gbc_lblAdate.gridy = 1;
		getContentPane().add(lblAdate, gbc_lblAdate);
		
		JLabel lblDatetimeSubs = new JLabel("New Date/Time Subscriptions: ");
		GridBagConstraints gbc_lblDatetimeSubs = new GridBagConstraints();
		gbc_lblDatetimeSubs.insets = new Insets(0, 0, 5, 5);
		gbc_lblDatetimeSubs.gridx = 2;
		gbc_lblDatetimeSubs.gridy = 4;
		getContentPane().add(lblDatetimeSubs, gbc_lblDatetimeSubs);
		
		JLabel lblAdatetimesubs = new JLabel("aDatetimeSubs");
		if (reportInfo != null)
			lblAdatetimesubs.setText(reportInfo.getString(2));
		GridBagConstraints gbc_lblAdatetimesubs = new GridBagConstraints();
		gbc_lblAdatetimesubs.insets = new Insets(0, 0, 5, 5);
		gbc_lblAdatetimesubs.gridx = 3;
		gbc_lblAdatetimesubs.gridy = 4;
		getContentPane().add(lblAdatetimesubs, gbc_lblAdatetimesubs);
		
		JLabel lblDatalayerSubs = new JLabel("New Datalayer Subscriptions: ");
		GridBagConstraints gbc_lblDatalayerSubs = new GridBagConstraints();
		gbc_lblDatalayerSubs.insets = new Insets(0, 0, 5, 5);
		gbc_lblDatalayerSubs.gridx = 2;
		gbc_lblDatalayerSubs.gridy = 6;
		getContentPane().add(lblDatalayerSubs, gbc_lblDatalayerSubs);
		
		JLabel lblAdatalayersubs = new JLabel("aDatalayerSubs");
		if (reportInfo != null)
			lblAdatalayersubs.setText(reportInfo.getString(3));
		GridBagConstraints gbc_lblAdatalayersubs = new GridBagConstraints();
		gbc_lblAdatalayersubs.insets = new Insets(0, 0, 5, 5);
		gbc_lblAdatalayersubs.gridx = 3;
		gbc_lblAdatalayersubs.gridy = 6;
		getContentPane().add(lblAdatalayersubs, gbc_lblAdatalayersubs);
		
		JLabel lblImagepackSubs = new JLabel("New Imagepack Subscriptions: ");
		GridBagConstraints gbc_lblImagepackSubs = new GridBagConstraints();
		gbc_lblImagepackSubs.insets = new Insets(0, 0, 5, 5);
		gbc_lblImagepackSubs.gridx = 2;
		gbc_lblImagepackSubs.gridy = 8;
		getContentPane().add(lblImagepackSubs, gbc_lblImagepackSubs);
		
		JLabel lblAimagepacksubs = new JLabel("aImagepackSubs");
		if (reportInfo != null)
			lblAimagepacksubs.setText(reportInfo.getString(4));
		GridBagConstraints gbc_lblAimagepacksubs = new GridBagConstraints();
		gbc_lblAimagepacksubs.insets = new Insets(0, 0, 5, 5);
		gbc_lblAimagepacksubs.gridx = 3;
		gbc_lblAimagepacksubs.gridy = 8;
		getContentPane().add(lblAimagepacksubs, gbc_lblAimagepacksubs);
		
		JLabel lblPurchasedImages = new JLabel("Purchased Images: ");
		GridBagConstraints gbc_lblPurchasedImages = new GridBagConstraints();
		gbc_lblPurchasedImages.insets = new Insets(0, 0, 5, 5);
		gbc_lblPurchasedImages.anchor = GridBagConstraints.EAST;
		gbc_lblPurchasedImages.gridx = 2;
		gbc_lblPurchasedImages.gridy = 11;
		getContentPane().add(lblPurchasedImages, gbc_lblPurchasedImages);
		
		JLabel lblApurimages = new JLabel("aPurImages");
		if (reportInfo != null)
			lblApurimages.setText(reportInfo.getString(5));
		GridBagConstraints gbc_lblApurimages = new GridBagConstraints();
		gbc_lblApurimages.insets = new Insets(0, 0, 5, 5);
		gbc_lblApurimages.gridx = 3;
		gbc_lblApurimages.gridy = 11;
		getContentPane().add(lblApurimages, gbc_lblApurimages);
		
		JLabel lblPurchasedSamples = new JLabel("Purchased Samples: ");
		GridBagConstraints gbc_lblPurchasedSamples = new GridBagConstraints();
		gbc_lblPurchasedSamples.insets = new Insets(0, 0, 5, 5);
		gbc_lblPurchasedSamples.anchor = GridBagConstraints.EAST;
		gbc_lblPurchasedSamples.gridx = 2;
		gbc_lblPurchasedSamples.gridy = 13;
		getContentPane().add(lblPurchasedSamples, gbc_lblPurchasedSamples);
		
		JLabel lblApursamples = new JLabel("aPurSamples");
		if (reportInfo != null)
			lblApursamples.setText(reportInfo.getString(6));
		GridBagConstraints gbc_lblApursamples = new GridBagConstraints();
		gbc_lblApursamples.insets = new Insets(0, 0, 5, 5);
		gbc_lblApursamples.gridx = 3;
		gbc_lblApursamples.gridy = 13;
		getContentPane().add(lblApursamples, gbc_lblApursamples);
		
		JLabel lblNewImages = new JLabel("New Images: ");
		GridBagConstraints gbc_lblNewImages = new GridBagConstraints();
		gbc_lblNewImages.insets = new Insets(0, 0, 5, 5);
		gbc_lblNewImages.anchor = GridBagConstraints.EAST;
		gbc_lblNewImages.gridx = 2;
		gbc_lblNewImages.gridy = 16;
		getContentPane().add(lblNewImages, gbc_lblNewImages);
		
		JLabel lblAnewimages = new JLabel("aNewImages");
		if (reportInfo != null)
			lblNewImages.setText(reportInfo.getString(7));
		GridBagConstraints gbc_lblAnewimages = new GridBagConstraints();
		gbc_lblAnewimages.insets = new Insets(0, 0, 5, 5);
		gbc_lblAnewimages.gridx = 3;
		gbc_lblAnewimages.gridy = 16;
		getContentPane().add(lblAnewimages, gbc_lblAnewimages);
		
		JButton btnBack = new JButton("Back");
		GridBagConstraints gbc_btnBack = new GridBagConstraints();
		gbc_btnBack.insets = new Insets(0, 0, 5, 5);
		gbc_btnBack.gridx = 9;
		gbc_btnBack.gridy = 17;
		getContentPane().add(btnBack, gbc_btnBack);
		
		JLabel lblArchiveSize = new JLabel("Archive Size: ");
		GridBagConstraints gbc_lblArchiveSize = new GridBagConstraints();
		gbc_lblArchiveSize.insets = new Insets(0, 0, 5, 5);
		gbc_lblArchiveSize.anchor = GridBagConstraints.EAST;
		gbc_lblArchiveSize.gridx = 2;
		gbc_lblArchiveSize.gridy = 18;
		getContentPane().add(lblArchiveSize, gbc_lblArchiveSize);
		
		JLabel lblAnewsamples = new JLabel("aNewSamples");
		if (reportInfo != null)
			lblAnewsamples.setText(reportInfo.getString(8));
		GridBagConstraints gbc_lblAnewsamples = new GridBagConstraints();
		gbc_lblAnewsamples.insets = new Insets(0, 0, 5, 5);
		gbc_lblAnewsamples.gridx = 3;
		gbc_lblAnewsamples.gridy = 18;
		getContentPane().add(lblAnewsamples, gbc_lblAnewsamples);
		
	}
	

}
